const translatePigLatin = str => {
  const consonantReg = /^[^aeiou]+/;
  if (consonantReg.test(str)) {
    const obj = str.match(consonantReg);
    const matchedStr = obj[0];
    return str.replace(matchedStr, "") + matchedStr + "ay";
  } else {
    return str + "way";
  }
}
